QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Note Event and Extended Note Event

The standard Note event ( Figure 5 ) supports most music requirements. The Note event allows up to 32 part numbers 0 to 31 and support pitches from 2 octaves below middle C to 3 octaves above. The Extended Note event ( Figure 6 ) provides a wider range of pitch values, microtonal values to define any pitch, and extended note duration. The Extended Note event requires two long words; the standard Note event requires only one.

Figure 5 Note event

Table 2Contents of a Note event

Note event type

first nibble value = 001X

Part number

unique part identifier

Pitch

numeric value of 0-63, mapped to 32-95

Velocity

0-127, 0 = no audible response (but used to indicate a NOTE OFF)

Duration

specifies how long to play the note in units defined by the media time scale or tune player time scale

The part number bit field contains the unique part identifier initially used during the TuneSetHeader call.

The pitch bit field allows a range from 0-63, which is mapped to the values 32-95 representing the traditional equal tempered scale. For example, the value 28 (mapped to 60) is middle C.

The velocity bit field allows a range from 0-127. A velocity value of 0 produces silence.

The duration bit field defines the number of units of time during which the part will play the note. The units of time are defined by the media time scale or tune player time scale.

Macro call used to stuff the Note event's long word:

qtma_StuffNoteEvent(x, instrument, pitch, volume, duration)

Macro calls used to extract fields from the Note event's long word:

qtma_Instrument(x)
qtma_NotePitch(x)
qtma_NoteVelocity(x)
qtma_NoteVolume(x)
qtma_NoteDuration(x)

Figure 6 Extended Note event

Table 3Contents of an Extended Note event

Extended Note event type

first nibble value = 1001

Part number

unique part identifier

Pitch

0-127 standard pitch, 60 = middle C 0x01.00 ... 0x7F.00 allowing 256 microtonal divisions between each notes in the traditional equal tempered scale

Duration

specifies how long to play the note in units defined by media time scale or tune player time scale

Velocity

0-127 where 0 = no audible response (but used to indicate a NOTE OFF)

Event tail

first nibble of last word = 10XX

The part number bit field contains the unique part identifier initially used during the TuneSetHeader call.

If the pitch bit field is less than 128, it is interpreted as an integer pitch where 60 is middle C. If the pitch is 128 or greater, it is treated as a fixed pitch.

Microtonal pitch values are produced when the 15 bits of the pitch field are split. The upper 7 bits defines the standard equal tempered note and the lower 8 bits defines 256 microtonal divisions between the standard notes.

Macro call used to stuff the extended Note event's long words:

qtma_StuffXNoteEvent(w1, w2, instrument, pitch, volume, duration)

Macro calls used to extract fields from the extended Note event's long words:

qtma_XInstrument(m, l)
qtma_XNotePitch(m, l)
qtma_XNoteVelocity(m, 1)
qtma_XNoteVolume(m, l)
qtma_XNoteDuration(m, l)

© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next